﻿using Adp;
using Microsoft.AspNetCore.Mvc;
using Yqd.Models;
using System.Linq;
using Yqd.Controllers.Filter;

namespace Yqd.Controllers
{
    [Area("Yqd")]
    public class WxUnitController : Controller
    {
        YqdContext ctx;

        public WxUnitController(YqdContext ctx)
        {
            this.ctx = ctx;
        }

       [User]
        public ActionResult GetList()
        {
            return this.ToJson(new
            {
                success = true,
                data = ctx.Yqd_Unit.Where(it=>it.UnitCode!= "330782000000").OrderBy(it => it.Tactic).Select(it => new
                {
                    name = it.Name,
                    value = it.UnitCode
                })
            });
        }
    }
}
